/*
* 请求示例
* this.$mao.http.post('login', {username:'张三', password: 'password'}, function(data){
* 	// success
* }, function(code, msg){
*	// error
*	// code = 错误码
*	// msg = 错误信息
* })
*/
import library from '@/mao-ui/library/http/library.js';

let http = {
	get: (route, params = {}, headers = {}, success = false, error = false) => {
		library.request(route, 'GET', params, headers, success, error);
	},
	post: (route, params = {}, headers = {}, success = false, error = false) => {
		library.request(route, 'POST', params, headers, success, error);
	},
	upload: (route, params = {}, success = false, error = false) => {
		library.request(route, 'UPLOAD', params, headers, success, error);
	}
}

export default http